Skip to content

[6.19.z] Change 'iop_advisor_engine' settings to 'iop'. - #20899

Merged
tpapaioa merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-429c0ccc2c5cd028041e8e8eaeb3929e3803c561
Feb 26, 2026
Merged

[6.19.z] Change 'iop_advisor_engine' settings to 'iop'.#20899
tpapaioa merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-429c0ccc2c5cd028041e8e8eaeb3929e3803c561

Conversation

@Satellite-QE

@Satellite-QE Satellite-QE commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20861

Problem Statement

iop_advisor_engine is not an accurate label anymore for IoP settings.

Solution

Change 'iop_advisor_engine' to 'iop'.

6.18.z and 6.17.z PRs will be done manually.

Related Issues

Summary by Sourcery

Rename IoP configuration usage from the deprecated iop_advisor_engine namespace to the new iop namespace across code, configuration validation, and tests.

Enhancements:

  • Update podman helper methods and IoP setup mixins to read IoP credentials and registry details from settings.rh_cloud.iop.
  • Adjust configuration validators and IoP image path handling to use the new rh_cloud.iop.image_paths key.
  • Refresh fixtures and tests to reference the new IoP settings namespace for image paths and authentication.

Summary by Sourcery

Rename the IoP configuration namespace from rh_cloud.iop_advisor_engine to rh_cloud.iop across runtime code, configuration validation, and tests.

Enhancements:

  • Update host podman helper methods and IoP setup mixins to read credentials, registries, and image paths from settings.rh_cloud.iop.
  • Adjust configuration validation to expect IoP image paths under rh_cloud.iop.image_paths instead of the deprecated iop_advisor_engine key.
  • Refresh fixtures and tests to consume the new rh_cloud.iop settings namespace for IoP image paths and authentication.

Summary by Sourcery

Rename the IoP configuration namespace from the deprecated iop_advisor_engine key to iop across runtime code, configuration validation, and tests.

Enhancements:

  • Update host podman helpers and IoP setup mixins to read credentials, registries, and image paths from settings.rh_cloud.iop.
  • Adjust configuration validation and deploy argument construction to use rh_cloud.iop.image_paths instead of the old iop_advisor_engine.image_paths key.
  • Align maintenance workflows and CLI/tests with the new rh_cloud.iop settings namespace for IoP-related operations.

@Satellite-QE Satellite-QE added 6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 26, 2026
@sourcery-ai

sourcery-ai Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Rename the IoP configuration namespace from rh_cloud.iop_advisor_engine to rh_cloud.iop across podman helpers, IoP setup, configuration validation, fixtures, and tests so they all consume the new settings structure.

Sequence diagram for IoP configuration using rh_cloud.iop settings

sequenceDiagram
    actor Tester
    participant IoPSetup
    participant Host
    participant Settings
    participant RhCloudSettings
    participant IopSettings
    participant PodmanRegistry

    Tester->>IoPSetup: configure_iop()
    IoPSetup->>Host: ensure_podman_installed()
    Host-->>IoPSetup: podman available

    IoPSetup->>Settings: rh_cloud
    Settings-->>IoPSetup: RhCloudSettings
    IoPSetup->>RhCloudSettings: iop
    RhCloudSettings-->>IoPSetup: IopSettings

    IoPSetup->>Host: podman_login(IopSettings.username, IopSettings.token, IopSettings.registry)
    Host->>PodmanRegistry: podman login using authfile
    PodmanRegistry-->>Host: login success

    IoPSetup->>Host: podman_login(IopSettings.stage_username, IopSettings.stage_token, IopSettings.stage_registry)
    Host->>PodmanRegistry: podman login stage registry
    PodmanRegistry-->>Host: login success

    IoPSetup-->>Tester: IoP configured with rh_cloud.iop
Loading

Sequence diagram for IoP deploy args using rh_cloud.iop.image_paths

sequenceDiagram
    actor Tester
    participant Fixture
    participant Settings
    participant RhCloudSettings
    participant IopSettings

    Tester->>Fixture: get_iop_deploy_args()
    Fixture->>Settings: rh_cloud
    Settings-->>Fixture: RhCloudSettings
    Fixture->>RhCloudSettings: iop
    RhCloudSettings-->>Fixture: IopSettings
    Fixture->>IopSettings: image_paths
    IopSettings-->>Fixture: {service: path}

    Fixture->>Fixture: build iop_service_image args from image_paths
    Fixture->>Settings: server.deploy_arguments.to_dict()
    Settings-->>Fixture: deploy_args

    Fixture->>Tester: merged deploy_args with IoP image args
Loading

Class diagram for IoP helpers and settings using rh_cloud.iop

classDiagram
    class Host {
        +ensure_podman_installed()
        +podman_login(username, password, registry)
        +is_podman_logged_in(registry)
        +podman_logout(registry)
    }

    class IoPSetup {
        +get_iop_image_paths() dict
        +configure_iop()
    }

    class Settings {
        +rh_cloud RhCloudSettings
        +server ServerSettings
    }

    class RhCloudSettings {
        +token str
        +iop IopSettings
    }

    class IopSettings {
        +username str
        +token str
        +registry str
        +stage_username str
        +stage_token str
        +stage_registry str
        +image_paths dict
    }

    class ServerSettings {
        +deploy_arguments DeployArguments
    }

    class DeployArguments {
        +to_dict() dict
    }

    class RhCloudValidators {
        +rh_cloud_token_required
        +iop_image_paths_default_dict
    }

    Host ..> Settings : uses
    IoPSetup ..> Host : configures
    IoPSetup ..> Settings : reads
    RhCloudSettings o-- IopSettings
    Settings o-- RhCloudSettings
    Settings o-- ServerSettings
    ServerSettings o-- DeployArguments
    RhCloudValidators ..> RhCloudSettings : validates iop.image_paths
Loading

File-Level Changes

Change Details Files
Update podman helper methods to read IoP credentials and registry from the new settings namespace.
  • Change podman_login to initialize iop_settings from settings.rh_cloud.iop instead of settings.rh_cloud.iop_advisor_engine.
  • Change is_podman_logged_in to default the registry from settings.rh_cloud.iop.registry.
  • Change podman_logout to default the registry from settings.rh_cloud.iop.registry.
robottelo/hosts.py
Adjust configuration validation to expect IoP image paths under rh_cloud.iop.image_paths.
  • Replace the rh_cloud.iop_advisor_engine.image_paths validator with rh_cloud.iop.image_paths, preserving the default and apply_default_on_none behavior.
robottelo/config/validators.py
Update IoP setup mixin to use image paths and credentials from the new IoP settings namespace.
  • Change get_iop_image_paths to iterate over settings.rh_cloud.iop.image_paths when building image arguments.
  • Change configure_iop to fetch IoP credentials and registries from settings.rh_cloud.iop instead of settings.rh_cloud.iop_advisor_engine.
robottelo/host_helpers/satellite_mixins.py
Update pytest fixtures that construct IoP deploy arguments or perform IoP-related logins to use the new settings namespace.
  • Change get_iop_deploy_args to build image_args from settings.rh_cloud.iop.image_paths.
  • Change the sat_maintain fixture to read IoP stage registry credentials from settings.rh_cloud.iop instead of settings.rh_cloud.iop_advisor_engine.
pytest_fixtures/core/sat_cap_factory.py
pytest_fixtures/component/maintain.py
Update tests to reference the new IoP settings namespace for credentials and registries.
  • Change CLI IoP install test to use settings.rh_cloud.iop instead of settings.rh_cloud.iop_advisor_engine.
  • Change health check test to use settings.rh_cloud.iop for podman registry settings.
tests/foreman/cli/test_rhcloud_iop.py
tests/foreman/maintain/test_health.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Since this is a namespace rename of a config key, consider temporarily supporting both rh_cloud.iop and rh_cloud.iop_advisor_engine (with a clear precedence) to ease rollout and avoid breaking existing configs that haven’t been migrated yet.
  • There are several repeated iop_settings = settings.rh_cloud.iop patterns across helpers and fixtures; you might want to introduce a small helper/accessor for IoP settings to centralize this and make future renames or structural changes less invasive.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since this is a namespace rename of a config key, consider temporarily supporting both `rh_cloud.iop` and `rh_cloud.iop_advisor_engine` (with a clear precedence) to ease rollout and avoid breaking existing configs that haven’t been migrated yet.
- There are several repeated `iop_settings = settings.rh_cloud.iop` patterns across helpers and fixtures; you might want to introduce a small helper/accessor for IoP settings to centralize this and make future renames or structural changes less invasive.

## Individual Comments

### Comment 1
<location path="robottelo/config/validators.py" line_range="341" />
<code_context>
-        Validator(
-            'rh_cloud.iop_advisor_engine.image_paths', default={}, apply_default_on_none=True
-        ),
+        Validator('rh_cloud.iop.image_paths', default={}, apply_default_on_none=True),
     ],
     repos=[
</code_context>
<issue_to_address>
**issue (bug_risk):** Consider backward compatibility with existing `rh_cloud.iop_advisor_engine.image_paths` configs.

By switching validation to `rh_cloud.iop.image_paths`, deployments that still set `rh_cloud.iop_advisor_engine.image_paths` will now get the default `{}` and leave `iop.image_paths` unset, potentially changing behavior without any explicit signal. To avoid silent misconfigurations, consider either reading from both keys (preferring `iop.image_paths`) or failing fast when the old key is set but the new one is not.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Validator(
'rh_cloud.iop_advisor_engine.image_paths', default={}, apply_default_on_none=True
),
Validator('rh_cloud.iop.image_paths', default={}, apply_default_on_none=True),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Consider backward compatibility with existing rh_cloud.iop_advisor_engine.image_paths configs.

By switching validation to rh_cloud.iop.image_paths, deployments that still set rh_cloud.iop_advisor_engine.image_paths will now get the default {} and leave iop.image_paths unset, potentially changing behavior without any explicit signal. To avoid silent misconfigurations, consider either reading from both keys (preferring iop.image_paths) or failing fast when the old key is set but the new one is not.

@tpapaioa
tpapaioa merged commit 70cd9fe into 6.19.z Feb 26, 2026
15 checks passed
@tpapaioa
tpapaioa deleted the cherry-pick-6.19.z-429c0ccc2c5cd028041e8e8eaeb3929e3803c561 branch February 26, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants